import java.util.Arrays;

public class TestDemo {
    public static void main(String[] args) {
        int[] array = {1,2,31,4,15};
        int[] copy = Arrays.copyOf(array,array.length*2);
        Arrays.fill(copy, array.length,copy.length, 1);
        System.out.println(Arrays.toString(copy));
    }
}
